#define DEBUG
#include <cstdio>
#include <cstring>

using namespace std;

const int maxs=10000, maxa=5000, inf=0x7ffffff;

int min(int a, int b) {
  return a<b ? a : b;
}

int main() {
  freopen("cactus.in", "r", stdin);
  freopen("cactus.out", "w", stdout);

  static int a[maxs+1], b[maxs+1], f[maxs+1][maxa+1];
  int s, w, k;
  scanf("%d %d %d", &s, &w, &k);
  for (int i=1; i<=s; i++) {
    scanf("%d %d", a+i, b+i);
  }

  int ans=inf, len=s;
  if (s*s*w>125000000) {
    len = 10;
  }
  for (int l=1; l<=s; l++) {
    memset(f[l-1], 127, sizeof(f[l]));
    f[l-1][0] = 0;
    for (int i=l; i<=s && i<l+len; i++) {
      for (int j=0; j<a[i]; j++) {
	f[i][j] = f[i-1][j];
      }
      for (int j=a[i]; j<=w; j++) {
	f[i][j] = min(f[i-1][j-a[i]]+b[i], f[i-1][j]);
      }
      if (f[i][w]<=k) {
	ans = min(ans, i-l+1);
	break;
      }
    }
  }
  printf("%d\n", ans<inf ? ans : -1);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
